/* 
 * File:   AmdConvertEnum.h
 * Author: Администратор
 *
 * Created on March 22, 2012, 9:49 PM
 */

#ifndef AMDCONVERTENUM_H
#define	AMDCONVERTENUM_H

#include <clAmdBlas.h>
#include <string>
#include <locale>

inline clAmdBlasTranspose toAmdTrans(const char* trans) {
	char t = std::tolower(trans[0], std::locale());	
	if (t == 'n') return clAmdBlasNoTrans;
	if (t == 't') return clAmdBlasTrans;
	return clAmdBlasConjTrans;
}

inline clAmdBlasUplo toAmdUplo(const char* uplo) {
	if (std::tolower(uplo[0], std::locale()) == 'u') return clAmdBlasUpper;
	return clAmdBlasLower;
}

inline clAmdBlasSide toAmdSide(const char *side) {
	if (std::tolower(side[0], std::locale()) == 'l') return clAmdBlasLeft;
	return clAmdBlasRight;
}

inline clAmdBlasDiag toAmdDiag(const char* diag) {
	if (std::tolower(diag[0], std::locale()) == 'u') return clAmdBlasUnit;
    return clAmdBlasNonUnit;
}

#endif	/* AMDCONVERTENUM_H */

